package com.itany.cloud.util;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 石小俊
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "响应数据",description = "用于存储响应的JSON数据的对象")
public class ResponseResult {
    @Schema(description = "业务逻辑状态码")
    private String responseCode;
    @Schema(description = "响应消息")
    private String message;
    @Schema(description = "响应数据")
    private Object returnObject;

    public static ResponseResult success() {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        return result;
    }

    public static ResponseResult success(Object returnObject) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        result.setReturnObject(returnObject);
        return result;
    }
}
